import java.util.Scanner;

public class Main {
    public static boolean isGoodNumber(int num) {
        boolean isGood = true;
        int digitIndex = 1;
        while (num > 0) {
            int digit = num % 10;
            if (digitIndex % 2 == 1 && digit % 2 == 0) {
                isGood = false;
                break;
            }
            if (digitIndex % 2 == 0 && digit % 2 == 1) {
                isGood = false;
                break;
            }
            num /= 10;
            digitIndex++;
        }
        return isGood;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int count = 0;
        for (int i = 1; i <= N; i++) {
            if (isGoodNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    }
}